﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using ExchangeHog.EHCore;
using ExchangeHog.MessageParser;

namespace POP3ClientTest
{
	class Program
	{
		static void Main(string[] args)
		{
			String appData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
			EHCore ehcore = new EHCore();
			String fnConfig = appData + System.IO.Path.DirectorySeparatorChar + "EHCore.cfg";

//			ehcore.createTestConfiguration(fnConfig);

			ehcore.loadConfiguration(fnConfig);

			ehcore.check();

			//POP3Client cl = new POP3Client(args[0], 110);
			//cl.connect();
			//cl.authenticate(args[1], ExchangeHog.Util.Util.StringToSecureString(args[2]));
			//String message = cl.retrieve(cl.numberOfMessages());
			//Console.WriteLine(message);

			////using (StreamWriter outfile = new StreamWriter("message.txt"))
			////{
			////	outfile.Write(message);
			////}

			//cl.disconnect();

			//IMAPClient client = new IMAPClient();
			//client.connect(args[3], 143);
			//client.login(args[4], Util.StringToSecureString(args[5]));
			//client.addMessage(ASCIIEncoding.ASCII.GetBytes(message));

			//client.disconnect();
		}
	}
}
